package org.popupcommunication.dao.impl;

import java.util.List;

import javax.persistence.Query;

import org.popupcommunication.dao.ResponseForumDAO;
import org.popupcommunication.model.ResponseForum;
import org.popupcommunication.model.SujetForum;
import org.springframework.stereotype.Repository;

@Repository
public class ResponseForumJpa extends GenericRepositoryJpa<ResponseForum> implements ResponseForumDAO{

	@Override
	public List<ResponseForum> getListResponses(SujetForum s) {
		Query query = this
				.getEntityManager()
				.createQuery(
						"SELECT r FROM ResponseForum r WHERE r.sujet=:s  ");
		query.setParameter("s", s);
		List<ResponseForum> lst = (List<ResponseForum>) query.getResultList();
		return lst;
	}

}
